home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
vol15n11.zip
/
NUMDIRS.BAT
< prev
next >
Wrap
DOS Batch File
|
1996-03-04
|
1KB
|
48 lines
@ECHO OFF
:: --- Set starting value
:: --- M=thousands, H=hundreds, T=tens, O=ones
:: --- This example starts at 7000
SET M=7
SET H=0
SET T=0
SET O=0
:Loop
:ReturnM
ECHO Directory is %M%%H%%T%%O% (put commands here)
:: --- Replace '7600' in next line with ending value
IF '%M%%H%%T%%O%'=='7600' GOTO OutOfLoop
SET Place=O
GOTO Inc
:ReturnO
IF NOT '%O%'=='0' GOTO Loop
SET Place=T
GOTO Inc
:ReturnT
IF NOT '%T%'=='0' GOTO Loop
SET Place=H
GOTO Inc
:ReturnH
IF NOT '%H%'=='0' GOTO Loop
SET Place=M
GOTO Inc
:Inc
IF '%Place%'=='O' SET Value=%O%
IF '%Place%'=='T' SET Value=%T%
IF '%Place%'=='H' SET Value=%H%
IF '%Place%'=='M' SET Value=%M%
IF '%Value%'=='0' SET %Place%=1
IF '%Value%'=='1' SET %Place%=2
IF '%Value%'=='2' SET %Place%=3
IF '%Value%'=='3' SET %Place%=4
IF '%Value%'=='4' SET %Place%=5
IF '%Value%'=='5' SET %Place%=6
IF '%Value%'=='6' SET %Place%=7
IF '%Value%'=='7' SET %Place%=8
IF '%Value%'=='8' SET %Place%=9
IF '%Value%'=='9' SET %Place%=0
GOTO Return%Place%
:OutOfLoop
FOR %%v IN (O T H M Place Value) DO SET %%v=